package com.csyf.manager.controller.system;

import com.csyf.manager.entity.SysAgentBalance;
import com.csyf.manager.entity.SysOrderProfit;
import com.csyf.manager.entity.SysTradeSummary;
import com.csyf.manager.service.SysTradeSummaryService;
import com.csyf.manager.service.impl.SysAgentBalanceBiz;
import com.csyf.manager.utils.page.JqGridVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author: casper
 * @Description: 报表管理
 * @Date: Created in 2018/11/29 15:27
 */
@Controller
@RequestMapping("/report")
public class SysReportController {

    @Autowired
    private SysTradeSummaryService sysTradeSummaryService;

    @Autowired
    private SysAgentBalanceBiz sysAgentBalanceBiz;

    /**
     * 当日交易统计报表
     * @param vo
     * @param rows
     * @param page
     * @return
     */
    @ResponseBody
    @PostMapping(value = "dailyTradeSumList")
    public JqGridVo dailyTradeSumList(SysTradeSummary vo, Integer rows, Integer page) {
        return sysTradeSummaryService.queryCurDateTrade(vo, page, rows);
    }

    /**
     * 收益统计报表
     * @param vo
     * @param rows
     * @param page
     * @return
     */
    @ResponseBody
    @PostMapping(value = "profitSumList")
    public JqGridVo profitSumList(SysOrderProfit vo, Integer rows, Integer page) {
        return sysTradeSummaryService.queryMchProfitList(vo, page, rows);
    }

    /**
     * 对账报表
     * @param vo
     * @param rows
     * @param page
     * @return
     */
    @ResponseBody
    @PostMapping(value = "billReportList")
    public JqGridVo orderDataList(SysTradeSummary vo, Integer rows, Integer page) {
        return sysTradeSummaryService.querydataByAgent(vo, page, rows);
    }

    /**
     * 余额汇总
     * @param vo
     * @param rows
     * @param page
     * @return
     */
    @ResponseBody
    @PostMapping(value = "balanceSummaryList")
    public JqGridVo balanceSummaryList(SysAgentBalance vo, Integer rows, Integer page) {
        return sysAgentBalanceBiz.queryOrderByUserId(vo, page, rows);
    }


}
